package com.doaio.serviceorder.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class HelloController {

    @Autowired
    private RestTemplate restTemplate;

    @ResponseBody
    @RequestMapping("/")
    public String index(){
        Long time = restTemplate.getForEntity("http://service-user/time",Long.class).getBody();
        return "word      " + time;
    }
}
